<template>
  <div class="page-tools">
    <el-row>
      <el-col style="background: rgba(244, 244, 245, 1)">
        <div v-if="text" class="before">
          <i class="el-icon-info" />{{ text }}
          <slot name="before" />
        </div>
      </el-col>
    </el-row>
  </div>
</template>

<script>
// 组件封装需要注意：设计props(数据不同，结构样式相同)，设计插槽(html结构不同)
export default {
  name: "PageTools",
  props: {
    text: {
      type: String,
    },
  },
};
</script>

<style scoped lang="scss">
.page-tools {
  margin: 10px 0;
  .before {
    line-height: 30px;
    i {
      margin-right: 5px;
      color: rgba(144, 147, 153, 1);
    }
    display: inline-block;
    padding: 0px 10px;
    border-radius: 3px;
    background: rgba(244, 244, 245, 1);
  }
}
</style>